package com.vipheyue.bigbusiness.activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.RadioButton;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.vipheyue.bigbusiness.R;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class SelectionCategoryActivity extends Activity {


    @Bind(R.id.iv_Menu_leftImg)
    ImageView iv_Menu_leftImg;
    @Bind(R.id.tv_Menu_leftTitle)
    TextView tv_Menu_leftTitle;
    @Bind(R.id.rl_menu_left)
    RelativeLayout rl_menu_left;
    @Bind(R.id.tv_Menu_Title)
    TextView tv_Menu_Title;
    @Bind(R.id.iv_menu_rightTitle)
    TextView iv_menu_rightTitle;
    @Bind(R.id.iv_menu_right)
    ImageView iv_menu_right;
    @Bind(R.id.rl_menu_right)
    RelativeLayout rl_menu_right;
    @Bind(R.id.et_search_companyName)
    EditText et_search_companyName;
    @Bind(R.id.rb_0)
    RadioButton rb_0;
    @Bind(R.id.rb_1)
    RadioButton rb_1;
    @Bind(R.id.rb_2)
    RadioButton rb_2;
    @Bind(R.id.rb_3)
    RadioButton rb_3;
    @Bind(R.id.rb_4)
    RadioButton rb_4;
    @Bind(R.id.rb_5)
    RadioButton rb_5;
    @Bind(R.id.rb_6)
    RadioButton rb_6;
    @Bind(R.id.rb_7)
    RadioButton rb_7;
    @Bind(R.id.rb_8)
    RadioButton rb_8;
    @Bind(R.id.rb_9)
    RadioButton rb_9;
    @Bind(R.id.rb_10)
    RadioButton rb_10;
    @Bind(R.id.bt_search)
    Button bt_search;
    private String search_jobType;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_selection_category);
        ButterKnife.bind(this);
        tv_Menu_Title.setText("搜索");
    }

    @OnClick({R.id.rl_menu_left, R.id.rb_0, R.id.rb_1, R.id.rb_2, R.id.rb_3, R.id.rb_4, R.id.rb_5, R.id.rb_6, R.id.rb_7, R.id.rb_8, R.id.rb_9, R.id.rb_10, R.id.bt_search})
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.rl_menu_left:
                finish();
                break;
            case R.id.rb_0:
                search_jobType = "普工";
                break;
            case R.id.rb_1:
                search_jobType = "文员";
                break;
            case R.id.rb_2:
                search_jobType = "翻译";
                break;
            case R.id.rb_3:
                search_jobType = "销售";
                break;
            case R.id.rb_4:
                search_jobType = "保安";
                break;
            case R.id.rb_5:
                search_jobType = "司机";
                break;
            case R.id.rb_6:
                search_jobType = "快递员";
                break;
            case R.id.rb_7:
                search_jobType = "收银员";
                break;
            case R.id.rb_8:
                search_jobType = "美容";
                break;
            case R.id.rb_9:
                search_jobType = "普工";
                break;
            case R.id.rb_10:
                search_jobType = "美发";
                break;
            case R.id.bt_search:
                String search_companyName = et_search_companyName.getText().toString();
                Intent intent = getIntent();
                if (!TextUtils.isEmpty(search_jobType)) {
                    intent.putExtra("search_jobType", search_jobType);
                }
                if (!TextUtils.isEmpty(search_companyName)) {
                    intent.putExtra("search_companyName", search_companyName);
                }
                setResult(RESULT_OK, intent);
                finish();
                break;
        }
    }
}
